/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package drivemachine;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.DosFileAttributes;

import static drivemachine.MainWin.scanner;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.WString;
import java.nio.file.FileStore;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.util.Arrays;
import javax.swing.filechooser.FileSystemView;

/**
 *
 * @author positron
 */
public class Main {



    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
		System.out.println(" "+ Util.listMountpoints());

		if(args.length==2) {
			String path = args[0];
			Scanner scanner= new Scanner();
			scanner.scan( path );
			scanner.calcSize();
			System.out.println("Scan complete, "+scanner.getFolderCount()+" folders traversed");
			try {
				scanner.save( args[1] );
			} catch(IOException e) {
				System.out.println("could not save file");
				e.printStackTrace();
			}
			return;
		}

		try {
			String lf = javax.swing.UIManager.getSystemLookAndFeelClassName();
			//System.out.println("Setting look'n'feel "+lf);
			javax.swing.UIManager.setLookAndFeel( lf );
		} catch (Exception e) {
			e.printStackTrace();
		}
		(new MainWin()).setVisible(true);
    }

}
